The Set method sets a named value in the registry. If the key portion of the specified named value does not already exist, the Set method adds the key and any specified subkeys to the registry. The Set method supports the named-value data types REG_SZ and REG_DWORD.
Set FullKeyValueName, Value [,Flush]
HKLM\Software\MyCompany\MyValue
The key portion of this parameter can be a key on either a local or a remote machine. Keys on a remote machine are specified by prefixing the key name with the machine name. For example:
\\RemoteMachine\HKLM\Software\MyProg
If Flush is set to TRUE, the method immediately writes the registry changes to the disk. Note that explicitly flushing registry changes to the disk may reduce server performance.
If Flush is FALSE, the method does not write the registry changes to the disk. They are instead written to disk by the registry's lazy flusher or when the system shuts down.
The default is FALSE.
The following example sets the named value MyNumber
of the registry key HKLM\Software\MyCompany\
to 12345 and the named value MyString
to "hello, world".
<% Set Reg = Server.CreateObject("IISSample.Registry") Reg.Set "HKLM\Software\MyCompany\MyNumber", 12345, True Reg.Set "HKLM\Software\MyCompany\MyString", "hello, world" %>